#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   anchor.py    
@Contact :   raogx.vip@hotmail.com
@License :   (C)Copyright 2017-2018, Liugroup-NLPR-CASIA

@Modify Time      @Author    @Version    @Desciption
------------      -------    --------    -----------
2022/4/4 7:40 下午   caijiahao      1.0         Bytedancer
'''

# import lib
import cv2 as cv
import  sys
sys.path.append('../')


# 目标检测画候选框方法
def draw_anchor(image_path, boxes, class_name):
    img = cv.imread(image_path)

    x1, y1, x2, y2 = int(boxes[0]), int(boxes[1]), int(boxes[2]), int(boxes[3])
    cv.rectangle(img, (x1, y1), (x2, y2), (255, 255, 255), thickness=2)
    cv.putText(img, class_name, (x1, y1), cv.FONT_HERSHEY_COMPLEX, 0.7, (0, 255, 0),
               thickness=2)
    # cv.imshow('head', img)
    cv.imwrite('/Users/bytedance/python/object_centric_vcd/test_data/normal_1_test.jpg', img)


if __name__ == '__main__':
    image_path = '/Users/bytedance/python/object_centric_vcd/test_data/normal_1.jpg'
    boxes = [701.0, 1056.0, 1350.0, 1301.0]
    draw_anchor(image_path, boxes, 'normal')
